home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 14
/
014.d81
/
pps #36
< prev
next >
Wrap
Text File
|
2022-08-26
|
4KB
|
245 lines
======================================
PEEKs, POKEs, & SYSes -- Part 36
By James Germany Weiler
and Alien Gardner
======================================
Bit-mapped graphics: how to do it
using the SYSPLOTTER routines.
- - - - - - - - - - - - - - - - - - -
Okay, so here's what you've been
waiting for -- the easy way to use
hi-res bit-mapped graphics -- use our
SYSPLOTTER routines.
First, you need to load them:
10 IFL=0THENL=1:LOAD"SYSPLOTTER.O",8,1
After that, it gets simple fast.
A. SETGRAPHIC
To set the bit mapped graphics
mode, SYS 49152.
B. CLEARGRAPHIC
To clear the graphics screen,
SYS 49158.
C1.COLORSMEAR
To set the background color,
SYS 49161, <0-15>.
C2.PLOTCOLOR
To set the "pen" color,
SYS 49164, <0-15>.
D1.DRAW
To plot a point,
SYS 49167, <0-319>, <0-199>.
D2.ERASE
To erase a point,
SYS 49170, <0-319>, <0-199>.
E. UNGRAPHIC
To turn off the graphics screen
and return to the text screen,
SYS 49155.
======================================
Now the details.
SETGRAPHIC (49152), UNGRAPHIC (49155),
and CLEARGRAPHIC (49158) are just
simple SYSes.
SETGRAPHIC turns on the bit-mapped
graphic screen with a base address
of 8192.
UNGRAPHIC turns on the normal text
screen.
CLEARGRAPHIC erases any bit-mapped
pattern on the high-resolution
screen. It is equivalent to poking
zeros into all memory locations from
8192 to 16191.
- - - - - - - - - - - - - - - - - - -
COLORSMEAR (49161) & PLOTCOLOR (49164)
are SYSes that must be followed by a
comma and one numeric expression.
The numeric expression should
evaluate from 0 to 15. It selects the
color of the background or pen for the
entire screen. The numeric expression
can be a constant, a variable, or
an expression.
Examples:
COLORSMEAR --
SYS 49161,2
will change the backgrond color of
the entire screen to red.
PLOTCOLOR --
Z = 0: SYS 49164,Z
will change the color of all the
plotted points on the screen to
black.
- - - - - - - - - - - - - - - - - - -
DRAW (49167) and ERASE (49170) are
SYSes that must be followed by two
numeric expressions separated by
commas. The first expression is
the horizontal position to plot and
should be in the range 0 to 319.
The second expression is the vertical
position and should be from 0 to 199.
Examples:
-- DRAW --
FOR A = 0 to 20
SYS 49167,A,A
NEXT A
will draw a short diagonal line in
the upper left corner of the screen.
-- ERASE --
FOR A = 0 to 10
SYS 49170,A*2,A*2
NEXT A
will turn the diagonal line we drew
in the previous example into a dotted
line by turning off every other dot
along its length. Erase will turn
off any dot, but you won't see it
working unless the dot was already
on.
======================================
We've done the hard part for you,
now how about some of you bright
programmers coming up with
applications using bit-mapped graphic
design? How about a business program
with bar charts and pie graphics?
How about a program to display math
functions? How about an astronomy
program? The possibilities are
endless!
If you need something to get you
started, take a look at the programs,
SINE.BAS and SINE.ML on this disk.
Compare the efficiency of the purely
BASIC program with the one that uses
our SYSPLOTTER routines. We think
you'll be excited.
We also have a wonderful application
of bit-mapped graphics. On this
issue of LOADSTAR, you will find a
program that will print high-res text
onto a bit-mapped screen. It is on
Side 2 and is called PLOTTEXT. It
only supports numbers, lower case
letters, periods, commas, dollar
signs, and percent signs.
The machine-language SYSPLOTTER
routines are on Side 2 of this issue
of LOADSTAR. They were written by
Alien Gardner with the MERLIN
assembler. The three BASIC programs
were written by James Germany Weiler
using the SYSPLOTTER routines.
Next time, we hope to have a version
of SYSPLOTTER that draw lines. Until
then, happy plotting!
If you wish to try any of the three
\oad"plotter boot",8
BASIC programs press the '\' key now.
---------< end of article >-----------